<style scoped>
    .expand-row{
        margin-bottom: 12px;
    }
</style>
<template>
    <div>
        <Row class="expand-row">
             <Table stripe border :columns="columns1" :data="data1"></Table>
             <!--
            <Col span="4">
                <span class="expand-key">操作: </span>
                <span class="expand-value"><Input value="退回" type="submit" style="width:50px"  readonly></Input></span>
            </Col> -->
        </Row>
    </div>
</template>
<script>
export default {
  data () {
    return {
      $ajax: null,

      path: this.$route.path,

      // 已处理列
      columns1: [{
        align: 'center',
        type: 'index',
        width: 60,
        title: '序号'
      },
      {
        align: 'center',
        title: '保单编号',
        key: 'insuranceId'
      },
      {
        align: 'center',
        title: '保险公司',
        key: 'bxCompanyName'
      },
      {
        align: 'center',
        title: '登陆帐号',
        key: 'bxAccountName'
      },
      {
        align: 'center',
        title: '登陆密码',
        key: 'bxAccountPwd'
      },
      {
        title: '操作',
        key: 'action',
        align: 'center',
        width: 140,
        render: function (h, param) {
          var vm = this
          return h('div', {}, [
            h('Button', {
              props: {
                type: 'info',
                size: 'small'
              },
              style: {
                fontSize: '12px'
              },
              on: {
                'click' () {
                  var params = {}
                  params.loanId = param.row.loanId
                  params.insuranceId = param.row.insuranceId
                  vm.$ajax.post(vm.$appContext.marvels_core_approve + '/approve/credit/report/service/refusedDate', params).then(re => {
                    var data = re.data
                    if (data.data === 0) {
                      vm.$Message.warning('退回出错，请重新退回!')
                    } else {
                      vm.$Message.success('退回成功!')
                      // vm.$router.back()
                      vm.$emit('jumpEvent')
                    }
                  }).catch(er => {
                    vm.$Message.error(er.message)
                  })
                }
              }
            }, '退回 ')
          ])
        }.bind(this)
      }
      ],
      data1: [ ]

    }
  },
  methods: {
    queryPage () {
      const vm = this
      var params = {
        loanId: vm.loanId
      }
      vm.$ajax.post(vm.$appContext.marvels_core_approve + '/approve/credit/report/service/getScreenshotsList', params).then(re => {
        vm.data1 = re.data.data.list
      }).catch(er => {

      })
    }
  },
  props: {
    row: Object
  },
  created () {
    // 初始化当前页面请求对象实例
    this.loanId = this.row.loanId
    this.$ajax = this.$util.ajax()
    this.queryPage()
  }
}
</script>
